package designpattern.simplefactory.commodity;

/**
 * 商品工厂
 */
public class CommodityFactory {
    public static ICommodity getCommodityInstance(CommodityEnum commodityType){
        if (commodityType.equals(CommodityEnum.COMMODITY_A)){
            return new CommodityA();
        }else if (commodityType.equals(CommodityEnum.COMMODITY_B)){
            return new CommodityB();
        }
        return null;
    }
}
